package com.wwz.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.wwz.entity.PermissionApi;
import com.wwz.entity.Result;
import com.wwz.service.IPermissionApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("permission/api")
@Api(tags = "API权限控制器")
public class PermissionApiController {

    @Resource
    private IPermissionApiService permissionApiService;

    @GetMapping("list/{id}")
    @ApiOperation("API列表")
    public Result getList(@PathVariable String id){
        List<PermissionApi> apis = permissionApiService.list(Wrappers.<PermissionApi>lambdaQuery()
                        .eq(PermissionApi::getId,id));
        return Result.ok(apis);
    }
}


